<template>
	<view class="header" style="margin-top: 15rpx;">
		<view class="city" @click="cityBox">
			<text>{{city.city}}</text>
			<image src="../../static/img/icon.png" mode=""></image>
		</view>
		<view class="input_box" >
			<input type="text" @focus="goSearch" v-model="search"  placeholder="搜索" placeholder-style="font-size:26rpx;color:#999;" />
			<uni-icons class="search_icon" type="search" color="#999" size="18"></uni-icons>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				
			}
		},
		props:['city','type','mid'],
		onLoad() {
			// if(uni.getStorageSync('cityChange')){
			// 	this.cityObj=JSON.parse(uni.getStorageSync('cityChange'))
			// 	console.log(this.cityObj)
			// }
		},
		onReady() {
			// if(uni.getStorageSync('cityChange')){
			// 	this.cityObj=JSON.parse(uni.getStorageSync('cityChange'))
			// 	console.log(this.cityObj)
			// }
		},
		mounted() {
			// if(uni.getStorageSync('cityChange')){
			// 	this.cityObj=JSON.parse(uni.getStorageSync('cityChange'))
			// 	console.log(this.cityObj)
			// }
		},
		onShow() {
			// if(uni.getStorageSync('cityChange')){
			// 	this.cityObj=JSON.parse(uni.getStorageSync('cityChange'))
			// 	console.log(this.cityObj)
			// }
		},
		methods:{
			cityBox(){
				uni.navigateTo({
				    url: '../home/choseCity'
				});
			},
			goSearch(){
				uni.navigateTo({
				    url: '../home/search?type='+this.type+'&mid='+this.mid
				});
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.header{
		width: 100%;
		height: 88rpx;
		text-align: center;
		line-height: 88rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		.city{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			text{
				font-size: 28rpx;
				font-weight: 500;
				color: #333333;
			}
			image{
				width: 13rpx;
				height: 8rpx;
				margin-left: 6rpx;
			}
		}
		
		.input_box{
			width: 394rpx;
			height: 54rpx;	
			margin-left: 23rpx;
			position: relative;
			.search_icon{
				position: absolute;	
				top:-14rpx;
				left: 21rpx;
			}
			input{
				box-sizing: border-box;
				padding-left: 66rpx;
				display: inline-block;
				width: 394rpx;
				text-align: left;
				height: 54rpx;
				background: rgba(0, 0, 0, 0.05);
				border-radius: 27rpx;
				
				
			}
		}
		
	}
</style>
